<?php echo $header; ?>
<div id="content">
<div class="page">
	<div class="personal_info">
    	Welcome,<span id="userName"><?php echo $this->customer->getLastName() ?></span>
					<a href="index.php?route=account/logout">logout</a>
    </div>
	<div class="greenPanel">
		<table width="95%" cellpadding="0" cellspacing="0" align="center" style="margin:auto;">
			<tr>
				<td colspan="3" align="left" height="50px">
					<a href="javascript:void(0)" style="float:left;background:url(catalog/view/theme/default/images/agreeItem.png);padding:8px 70px 17px 62px;">Account</a>
				</td>
			</tr>
			<tr>
				<?php echo $left; ?>
				<td style="height:500px;" valign="top" class="ManageMain">
				<ul>
					<li>My Orders</li>
				</ul>
				<?php if ($orders) { ?>
				<?php foreach ($orders as $order) { ?>
					<table width="100%" cellspacing="0" cellpadding="0" class="list" style="display: table">
						<tr>
							<th width="25%" class="textleft"><?php echo $text_order_id; ?> <?php echo $order['order_id']; ?></th>
							<th width="40%">&nbsp;</th>
							<th width="35%"><?php echo $text_status; ?><?php echo $order['status']; ?><?php if($order['status']=='Shipped'){?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.canadapost.ca/cpotools/apps/track/personal/findByTrackNumber?trackingNumber=<?php echo $order['track_num']; ?>&LOCALE=en " target="_blank">Tracking</a><?php }?></th>
						</tr>
						<tr>
							<td class="textleft"><?php echo $text_date_added; ?> <?php echo $order['date_added']; ?></td>
							<td class="textleft"><?php echo $text_customer; ?> <?php echo $order['name']; ?></td>
							<td style=" text-align:center;">
								<a href="<?php echo $order['reorder']; ?>">Reorder</a>
							</td>
						</tr>
						<tr>
							<td class="textleft"><?php echo $text_products; ?> <?php echo $order['products']; ?></td>
							<td class="textleft"><?php echo $text_total; ?>:<?php echo $order['total']; ?></td>
							<td style=" text-align: center;"><a href="<?php echo $order['href']; ?>">View</a></td>
						</tr>
					</table>
				<?php }?>
				<div class="pagination"><?php echo $pagination; ?></div>
				<?php } else { ?>
				<div class="content"><?php echo $text_empty; ?></div>
				<?php } ?>
			</td>
		</tr>
	</table>
</div>
<?php echo $footer; ?>